These files may be freely distributed and used, so long as the following Conditions are met:
• This package is EgoWare. If you use it, you're obligated to send me a message, telling me how great this software is, and how wonderful I am for creating it. You may leave me this message at any of the following places:
Bob Blaylock on The Bowhead Whale BBS @ (805)964-UNIX
B.BLAYLOCK on GEnie
TheBob on America OnLine.
• All of these files must be distributed together. You may not distribute only a part of this set. The complete set includes the following files:
HangUp.doc This text file which you are reading now.
HangUp FKEYs A file containing four FKEYs.
HangUp.PROC A White Knight™ Procedure.
• This copyright statement must accompany any copy of this package which is distributed. This statement must not, under any circumstances, be altered in any way.
• If you distribute any copies of this package, in which any of the files have been altered, then you must, at the end of this document, add a paragraph or so describing the alterations which you have made.
• No other copyrights may be claimed on this package, or any files contained therein, either by itself, or as part of a larger collective work, nor may any restrictions be placed upon the further distribution of this package, other than those listed in this copyright statement.
• This package may not, under any circumstances, be uploaded to, or distributed by, CompuServe Information Services.
Who Can Use HangUp:
-------------------
This document assumes a fair degree of electronic skill, and knowledge of the Macintosh hardware. At the every least, you should be capable of wiring a modem cable.
Anyone who is using a modem that supports MNP5, V.42bis, or any other conditions which may result in the serial port connection between the modem and the computer being at a higher rate than the actual throughput of the modem, and who is using a Macintosh which is compatible with this package, may benefit from it.
This package was developed on an original 68020-based Macintosh II, under System 7.01. It is known to be compatible on this machine, under this environment. I see no reason why it should be incompatible with any other version of the system software, either past, or future. It should be compatible with most Macintosh models.
Though I have not had an opportunity to test this, I think this software is NOT compatible with the Macintosh IIfx. This software writes directly to the 8530 SCC chip, which, in the Mac IIfx, is isolated from the CPU by some other chips. According to "Guide to the Macintosh Hardware", Second Edition, attempting to directly access the SCC on a Macintosh IIfx will result in a bus error.
If anyone out there knows of a “proper” non-hardware-specific of manipulating the tri-state attribute of the TxD lines on the Macintosh serial ports, which can be counted on to work on all Macintosh models, present and future, I would love to hear about it.
This software should work on any Macintosh model earlier than the IIfx. At this writing (October 13th, 1991), the only existing models which I am not resonably sure about compatibility with this software are the Macintosh LC and the Macintosh IIsi. Of course any future models which, like the IIfx, isolate the 8530 from the CPU, or which do not have their serial ports based on the 8530 at all, will not be compatible with this software.
What It's For:
--------------
Back in the days when modems were much simpler, having a single handshaking line in each direction on the Macintosh serial ports was enough. You'd use the HSKo line (Handshake Out) line to drive the DTR line on the modem, and probably not use the HSKi (Handshake In) line at all.
With protocols like MNP5 and V.42bis, many newer modems require some form of flow control between themselves and the computers to which they are attached, in order to prevent the computer from trying to send data out the modem faster than the modem can send it, or to prevent the modem from sending data to the computer faster than the computer can process it. This is usually done by hardware handshaking.
In the context of a Macintosh, this means using the HSKi and HSKo lines to perform this handshaking, which is fine, except that it leaves no extra line for the Macintosh to use to drop the DTR on the modem to hang up.
As it turns out, the RTS line from the 8530 is used to tristate the TxD+ and TxD- lines on the Macintosh serial ports. When RTS is high, TxD+ and TxD- display opposite voltage levels, depending on the state of the TxD output on the 8530. When RTS is low, TxD+ and TxD- are in the open state; providing no voltage, and a high impedance.
The HangUp RCMD (for use in White Knight) and the various HangUp FKEYs cause the RTS output of the 8530 to be dropped for one second, then raised again. With a specially-wired cable (which will be described shortly), the high-impedance state of the TxD+ and TxD- lines will result in a low state being passed momentarily to the DTR line on the modem.
How To Wire the Cable:
----------------------
DIN-8 (Macintosh) DB-25 (Modem)
HSKo 1 -------------> 4 RTS
HSKi 2 <------------- 5 CTS
TxD- 3 -------------> 2 TxD
Gnd 4 -------------- 7 Gnd
RxD- 5 <------------- 3 RxD
TxD+ 6 Not Connected (Yet)
GPi 7 <------------- 8 DCD
RxD+ 8 (Connect to pin 4 on the same connector)
The cable, as wired so far, would be a good standard cable for using a handshaking modem with a Macintosh, if you weren't using HangUp. You would, of course, have to disable the DTR line on the modem.
Now, to wire up the part for controlling the DTR line.
To begin with, take two diodes. It really doesn't much matter what kind of diodes you use. Any common silicon or germanium diodes should work just fine. Connect the cathodes together, and to pin 20 on the DB-25.
Connect the anode of one diode to pin 3 on the DIN-8, and the other to pin 6 on the DIN-8. Since normally, there is always a positive voltage on either TxD+ or TxD-, the diodes arranged in this way will cause whichever line is high to hold the DTR line high.
Connect a 100µF electrolytic capacitor between pins 20 and 22 on the DB-25, with the positive side connected to pin 20.
Finally, connect a 2.2KΩ resistor between pins 20 and 22 on the DB-25, in parallel with the capacitor.
Here's a schematic, to show this portion of the cable:
DIN-8 (Macintosh) DB-25 (Modem)
TxD- 3 --->|---+----------- 20 DTR
|
TxD+ 6 --->|---+-/\/\/\/-+- 22 RI
| 2.2KΩ |
| + - |
+----|(---+
100µF
You'll have to use your imagination a bit. Just try to see “->|-” as a symbol for a diode, “-/\/\/\/-” as a resistor, and “-|(-” as a capacitor.
This should be all you need as far as building a cable.
Using the Software:
-------------------
The software is included in two forms. HangUp.PROC is a procedure to be called under White Knight. You may invoke it with the Initiate Procedure… command in White Knight, or set up a keyboard macro which calls it. You may also call this procedure from your own procedures by using the NEST statement.
The actual HangUp code is in an RCMD resource contained in the resource fork of HangUp.PROC. This RCMD automatically determines which serial port you're using, and how many bits/character. HangUp needs to know this, because the same 8530 register that is used to control the RTS line also sets the bits/character.
The other form in which HangUp is provided is a set of FKEYs. Since the FKEYs have no way of knowing which serial port you're using, or how many bits/character, you'll need to make sure you invoke the correct one. At this writing, four are provided. HangUp A8 and HangUp A7 are to be used for the modem port, with 8 and 7 bits/character respectively. Similarly, HangUp B8 and HangUp B7 are for use with the printer port. You may renumber these FKEYs with ResEdit to invoke them in the normal way; better yet, get a utility like QuickKeys which you can use to assign a more logical keystroke to them.
To use these FKEYs, you need to copy them into your system using ResEdit or some other utility, or open them with a utility like Suitcase.
I guess there's not a whole lot more to say about this software. When any form of this software is invoked, it simply writes to the 8530 SCC to tell it to drop the RTS line (which results in the TxD lines on the serial port being opened) waits one second, then writes the SCC again to raise the RTS signal.
For comments, bug reports, suggestions, or whatever, I can be reached most readily at the Bowhead Whale BBS, at (805)964-UNIX. Just send mail there to "Bob Blaylock".
I can also be reached less quickly on America OnLine by the name "TheBob", or on GEnie, as "B.Blaylock".